#include <iostream>
using namespace std;

class Building;

class GoodGay
{
public:
  GoodGay();

public:
  Building *building;

  void visit(); // 参观函数，访问building中的属性
};

class Building
{
  // GoodGay 是本类的好朋友，可以访问本类的私有属性
  friend class GoodGay;
public:
  Building();

public:
  string m_sittingRoom; // 客厅

private:
  string m_bedRoom; // 卧室
};

// 类外写成员函数
Building::Building()
{
  m_sittingRoom = "客厅";
  m_bedRoom = "卧室";
}

GoodGay::GoodGay()
{
  // 创建建筑物对象
  building = new Building();
}

void GoodGay::visit()
{
  cout << "好基友类正在访问" << building->m_sittingRoom << endl;
  cout << "好基友类正在访问" << building->m_bedRoom << endl;
}

void test01()
{
  GoodGay gg;
  gg.visit();
}

int main(int argc, char const *argv[])
{

  test01();

  return 0;
}